const fp = require('lodash/fp');
let cars = [
    {
        name:'car1',
        in_stock:false,
        dollar_value:1,
    },
    {
        name:'car2',
        in_stock:true,
        dollar_value:1,
    },
];
let _average = function(xs){
    return fp.reduce(fp.add,0,xs) / xs.length;
};
let averageDollarValue = fp.flowRight(_average,fp.map(fp.prop('dollar_value')));
console.log(averageDollarValue(cars));